home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
c
/
cxref_1_4a.lha
/
FAQ
< prev
next >
Wrap
Text File
|
1997-06-22
|
18KB
|
463 lines
CXREF VERSION 1.4 - FREQUENTLY ASKED QUESTIONS AND ANSWERS
==========================================================
This file contains a list of frequently asked questions and their answers
relating to cxref version 1.4.
Not all of the questions here are real users questions, some of them have been
made up to give some help to people trying to use the program who find that the
README documentation is insufficient.
--------------------------------------------------------------------------------
Section 0 - Why doesn't this FAQ answer my question?
--------------------
Section 1 - What does cxref do (and what it doesn't)
Q 1.1 Does cxref support C++?
Q 1.2 Does cxref show which #includes that are not needed?
Q 1.3 Can cxref document automatic function variables?
Q 1.4 Does cxref run on systems other than UNIX?
--------------------
Section 2 - When cxref does not work
Q 2.1a How do I find out what is causing the parse error?
Q 2.1b What does this parse error message mean?
Q 2.2 Where are files doc/cxref.html & FAQ.html referenced from README.html?
Q 2.3 Why are half of the cross references missing?
Q 2.4 Why can't cxref process my header file in isolation?
Q 2.5 Why can't LaTeX process the output files?
Q 2.6 Why does the include file name have the complete path name?
--------------------
Section 3 - How to make cxref do what you want
Q 3.1 How do I use cxref to process source files in more than one directory?
Q 3.2 How can I add my own information to the output files?
Q 3.3 Can I get a subset of the cross-reference information?
Q 3.4 Is there an easy way to generate the comments in the correct format?
Q 3.5 How do I produce LaTeX output from a single source.c.tex output file?
Q 3.6 How can I pass extra arguments to the C pre-processor?
Q 3.7 Can I cross-reference my source code at the same time as compiling it?
Q 3.8 What use is the .cxref configuration file?
--------------------
Section 4 - More information about cxref
Q 4.1 Who wrote cxref, When and Why?
Q 4.2 How do I report bugs in cxref?
--------------------------------------------------------------------------------
Section 0 - Why doesn't this FAQ answer my question?
This FAQ is released with each new version of the cxref program, so if the
question is one that is frequently asked about the new version then you will by
definition not find the answer here.
You can find the latest information about cxref at the cxref web-page, this
contains among other things a list of bug-fixes for the latest version.
http://www.gedanken.demon.co.uk/cxref/
--------------------------------------------------------------------------------
Section 1 - What does cxref do (and what it doesn't)
--------------------
Q 1.1 Does cxref support C++?
No.
The cxref program only works for C, More specifically:
1) ANSI standard C with some leniency for common non-ANSI syntax.
For example, the construct 'switch(foo) { case 1: ... default: }' is not
ANSI, there must be a ';' after the default label, but it is accepted by
cxref.
2) Traditional (K&R) function declarations, with implicit 'int' and 'void'.
For example 'foo(){}' is parsed as if 'int foo(void){}' was specified.
3) The ability to parse GCC extensions.
The GCC '__attribute__' and '__extension__' keywords and most of the
other GCC extensions. The 'inline' keyword is allowed.
--------------------
Q 1.2 Does cxref show which #includes that are not needed?
No.
The output of the cxref program cross-references all of the functions,
variables, type definitions, included file etc. There is not a way of
identifying files that are included in another source file that do not need to
be.
--------------------
Q 1.3 Can cxref document automatic function variables?
No.
The inclusion of automatic variables in the output is not included. This is
because of the number of them in a typical function. In theory it could be made
to do this.
--------------------
Q 1.4 Does cxref run on systems other than UNIX?
For example DOS / Win3 / Win95 / WinNT / OS/2.
UNIX = Yes
This is the system that the program way designed and initially written
for, it should work on many versions of UNIX.
I know that it works on Linux, SunOS 4.1.x, Solaris 2.x, AIX & HP-UX 10.
DOS/Win3 = No
The program was not designed for DOS, the filenames used and the
multi-process nature of the program do not allow this.
Win95/WinNT = Maybe
Since Windows 95 and Windows NT claim to be real 32-bit multi-tasking
operating systems, and support the long filenames that are required, it
should in theory be possible to get the program working on these.
I have reports that it is possible, but I do not support cxref for these
OSes.
OS/2 = Maybe
As for Windows 95 / Windows NT above.
I have reports that it is possible with OS/2 Warp with emx, but I do not
support cxref for this OS.
--------------------------------------------------------------------------------
Section 2 - When cxref does not work
--------------------
Q 2.1a How do I find out what is causing the parse error?
The following error message is generated by cxref when parsing a source file
(with YYDEBUG set to 0 in parse-yy.h when cxref was compiled).
test.c: 4: parse error, expecting `','' or `';''
^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
file line type of error
name number generated by yacc
The error is on line 4 of the file test.c. In this case, the error message that
the yacc parser is generating is of some help, more often the error message is
just 'parse error'.
If YYDEBUG was set to 1 in parse-yy.h, then a more detailed error message would
be given (see Q 2.1b).
Q 2.1b What does this parse error message mean?
The following error message is generated by cxref when parsing a source file
(with YYDEBUG set to 1 in parse-yy.h when cxref was compiled).
test.c: 4: parse error, expecting `','' or `';''
The previous 10, current and next 10 symbols are:
-8 | 296 : INT : int
-7 | 258 : IDENTIFIER : foo
-6 | 40 : : (
-5 | 292 : VOID : void
-4 | 41 : : )
-3 | 123 : : {
-2 | 296 : INT : int
-1 | 258 : IDENTIFIER : a
0 | 296 : INT : int
1 | 258 : IDENTIFIER : b
2 | 59 : : ;
3 | 125 : : }
END OF FILE
^^^ ^^^^^^^^^^ ^^^^^
symbol symbol symbol
number type value
From this we can reconstruct part of the file test.c, using the previous and
next 10 symbol values from the lexer.
int foo(void) { int a int b; }
^
This is where the parse error occured, after 'int a' and before 'int b;'.
The cause of the error is now clear, there is a ';' missing after the
declaration of the variable a.
The cxref program is intended to be used on source files that are known to
compile with a C compiler. In this case a parse error message should not be
seen except for either non-standard C, (and compiler) or a bug in cxref.
--------------------
Q 2.2 Where are files doc/cxref.html & FAQ.html referenced from README.html?
The README.html file has a reference to the files doc/cxref.html and FAQ.html
these files are only present when 'make docs' has been run to generate the cross
references for the cxref program itself.
--------------------
Q 2.3 Why are half of the cross references missing?
The way that cxref works is that it processes all of the source files for a
program, one at a time and generates a cross reference database. A second pass
of the program is required to generate all of the cross references from the
database of cross reference information.
For this reason, the Makefile for the doc directory of cxref uses 'cxref *.c
-xref -Odoc' for the first pass and 'cxref *.c -xref -Odoc -html -latex' for the
second pass. The first to build the database, the second to produce the
outputs.
The reason that the cross reference